Exercise: OpenGL Transformations 2D (Solar System)
EX_OPENGL_TRANSFORMATIONS_SOLAR
Part A
- Draw a large yellow disk at the centre of the screen, representing the Sun.
- Compile and Execute.
Part B
- Modify the code in part A to all a smaller blue square ('Earth') a distance
away from the 'sun'.
- Animate the scene to have the Earth orbit the sun.
- Compile and Execute.
Part C
- Modify the code in part B to have the Earth spin on its own axis.
- The Earth should spin 365 times for every orbit of the Sun.
- Compile and Execute.
Part D
- Modify the code in part C to add a small grey triangle('Moon') orbiting
close to the 'Earth'
- The Moon should spin around the Earth once for every 28 spins of the earth.
- Compile and Execute.
Part D
- Modify the code in part D to add a red pentagon('Mars') orbiting the Sun
a little further out.
- Mars has two small moons, add these as pixels. Have them rotate about mars.
- Compile and Execute.